<div class="indhold">
<?php





?>
<h3 class="rubrik"><? echo $navne[0]." er"; ?></h3>
<form action="<? echo base_url(); ?>rettighed/ret_hemmelig_element/<? echo $type; ?>/<? echo $stamdata['id']; ?>" method="post">
<p class="rubrik"><input type="radio" name="hemmelig" value="1" <? if($stamdata['hemmelig']==1){ echo "checked='checked'";}?>>offentlig<br>
<input type="radio" name="hemmelig" value="3" <? if($stamdata['hemmelig']==3){ echo "checked='checked'";} ?>>hemmelig</p>
<input style="float:right" type="submit" value="ret">
</form>
<?

if($stamdata['hemmelig'] == 1){
	echo "<p class='rubrik'><b>Synlig for alle</b></p>";
}
else{

	$element = new element();
	$element->find_synlig_for($stamdata['id']);
	$synlig_for = $element->synlig_for;

	echo "<p class='rubrik'><b>Synlig for individer:</b></p>";
	echo "<p class='ink'>";
	foreach($synlig_for as $s){
		if($s['type_kvant'] == "individ"){
			echo anchor("core/vis/se/individ/".$s['id'], $s['navn'], "target='_blank'");
			echo anchor("rettighed/slet_synlig_for_element/".$type."/".$stamdata['id']."/".$s['id'], "(x)");
			echo br();
		}
	}
	echo "</p>";

	echo "<p class='rubrik'><b>Synlig for grupper:</b></p>";
	echo "<p class='ink'>";
	foreach($synlig_for as $s){
		if($s['type_kvant'] == "gruppe"){
			echo anchor("core/vis/se/gruppe/".$s['id'], $s['navn'], "target='_blank'");
			echo anchor("rettighed/slet_synlig_for_element/".$type."/".$stamdata['id']."/".$s['id'], "(x)");
			echo br();
		}
	}
	echo "</p>";

	$data['find_ikke'] = $element->synlig_for_ider;
	$data['omraade'] = "entitet";
	$data['type'] = $type;
	$data['stam_id'] = $stamdata['id'];
	$data['redirect_soegning'] = base_url()."core/vis/se/".$type."/".$stamdata['id']."/rediger_deling";
	$data['redirect_tilfoej'] = base_url()."rettighed/tilfoej_synlig_for_element";
	$this->load->view('soeg/soeg_generel', $data);


}
?>
</div>


